<template>
  <div>
    <el-tooltip :content="$t('message.navBar.guide')">
      <svg-icon
        id="guide-start"
        icon="guide"
        color="#4A4A4A"
        @click="guideStart"
      ></svg-icon>
    </el-tooltip>
  </div>
</template>
<script setup>
import Driver from 'driver.js'
import 'driver.js/dist/driver.min.css'
import { onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
import steps from './steps'
const i18n = useI18n()
let driver = null
onMounted(() => {
  driver = new Driver({
    allowClose: false,
    closeBtnText: i18n.t('message.guide.close'),
    nextBtnText: i18n.t('message.guide.next'),
    prevBtnText: i18n.t('message.guide.prev')
  })
})
const guideStart = () => {
  driver.defineSteps(steps(i18n))
  driver.start()
}
</script>
<style lang="scss"></style>
